﻿{% extends "admin/base.html" %}
{% load i18n %}

{% block content %}
<div class="wrap">
 	<h2 class="title1">{% trans 'User management' %}</h2>
	<table class="list">
		<thead>
			<tr>
				<th class="check-column">
					<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
				<th>{% trans 'username' %}</th>
				<th>{% trans 'full name' %}</th>
				<th>{% trans 'e-mail address' %}</th>
				<th>{% trans 'active' %}</th>
				<th>{% trans 'superuser status' %}</th>
				<th>{% trans "Register Date" %}</th>
				<th>{% trans 'last login' %}</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<th class="check-column">
					<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
				<th>{% trans 'username' %}</th>
				<th>{% trans 'full name' %}</th>
				<th>{% trans 'e-mail address' %}</th>
				<th>{% trans 'active' %}</th>
				<th>{% trans 'superuser status' %}</th>
				<th>{% trans "Register Date" %}</th>
				<th>{% trans 'last login' %}</th>
			</tr>
		</tfoot>
		<tbody>
			{% if user %}
			<tr valign="middle">
				<th scope="row" class="check-column">
					<input type="checkbox" name="checks" value="{{ user.id }}">
				</th>
				<td>
					<a href="{{ blog.get_admin_profile_url }}">
						<img width="32" height="32"
							src="/site_media/{% if user.get_profile.image_url %}{{ user.get_profile.image_url }}{% else %}/senbzblog/static/images/default_user_picture.png{% endif %}" 
							alt="" style="float:left;margin-top:3px;margin-right:10px;">
		             	<strong>{{ user.username }}</strong>
	             	</a>
	         	</td>
		   		<td>{{ user.first_name }} {{ user.last_name }}</td>
		       	<td>{{ user.email }}</td>
		       	<td>{{ user.is_active }}</td>
		       	<td>{{ user.is_superuser }}</td>
		       	<td>{{ user.date_joined|date:"Y-m-d H:i:s" }}</td>
		       	<td>{{ user.last_login|date:"Y-m-d H:i:s" }}</td>
			</tr>
			{% else %}
			<tr>
				<td colspan="8" align="center" style="font-size: 16px;">{% trans "No user" %}</td>
			</tr>
			{% endif %}
		</tbody>
	</table>
 	{%if users%}
 	{%endif%}
</div>
{%endblock%}